package com.osfw.activiti.entity.running;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 流程与身份关系表
 */
@Data
@Accessors(chain = true)
public class ActRuUser {

    /* 主键ID */
    @TableId(value = "id_", type = IdType.ASSIGN_ID)
    private Long id;

    /* 流程定义ID */
    @TableField(value = "proc_def_id_")
    private Long procDefId;

    /* 流程实例ID */
    @TableField(value = "proc_inst_id_")
    private Long procInstId;

    /* 流程任务ID */
    @TableField(value = "proc_task_id_")
    private Long procTaskId;

    /* 用户在该流程实例中的扮演类型（其值可为：starter-发起人、participant-参与人、assignee-受让人、candidate-候选人、owner-所有者） */
    @TableField(value = "user_type_")
    private String userType;

    /* 用户组ID */
    @TableField(value = "group_id_")
    private Long groupId;

    /* 用户组名称 */
    @TableField(value = "group_name_")
    private String groupName;

    /* 用户ID */
    @TableField(value = "user_id_")
    private Long userId;

    /* 用户姓名 */
    @TableField(value = "user_name_")
    private String userName;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("procDefId", getProcDefId())
                .append("procInstId", getProcInstId())
                .append("procTaskId", getProcTaskId())
                .append("userType", getUserType())
                .append("groupId", getGroupId())
                .append("groupName", getGroupName())
                .append("userId", getUserId())
                .append("userName", getUserName())
                .toString();
    }
}
